<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form action="?" method="post" id="dform">
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
<input type="hidden" name="file" value="<?php echo $file;?>"/>
<input type="hidden" name="action" value="<?php echo $action;?>"/>
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/>
<input type="hidden" name="forward" value="<?php echo $forward;?>"/>
<div class="tt"><?php echo $tname;?></div>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
    <td class="tl"><span class="f_red">*</span> 信息类型</td>
    <td>
		<?php foreach ($TYPE as $k => $v) { ?>
        <input type="radio" name="post[typeid]" value="<?php echo $k;?>" <?php if ($k == $typeid) echo 'checked';?> id="typeid_<?php echo $k;?>"/> <label for="typeid_<?php echo $k;?>" id="t_<?php echo $k;?>"><?php echo $v;?></label>&nbsp;
		<?php } ?>
    </td>
</tr>
<tr>
    <td class="tl"><span class="f_red">*</span>标题</td>
	<td><input name="post[title]" type="text" id="title" size="60" datatype="*2-999" nullmsg="请填写标题" errormsg="最少输入2个字符" value="<?php echo $title;?>"/> <?php echo level_select('post[level]', '级别', $level, 'id="level"');?></td>
</tr>
<tr>
    <td class="tl"><span class="f_red">*</span> 所属分类</td>
	<td><?php echo Post::catTree('post[catid]', $moduleid, '选择分类' ,$catid, 'datatype="n" nullmsg="请选择分类"');?></td>
</tr>
<tr id="carcatTr" >
	<td class="tl"> 适用车型</td>
	<td class="tr">
		<?php echo Post::autoCombo('post[arbid][]','post[arcid][]', 'post[amid][]', $item['arbid'],$item['arcid'],$item['amid'], 0, 0, 0) ;?>
	</td>
</tr>
    <tr>
        <td class="tl"><span class="f_hid">*</span> 交易条件</td>
        <td>
            <table width="100%">
                <tr>
                    <td width="70">需求数量</td>
                    <td><input name="post[amount]" type="text" size="20" value="<?php echo $amount;?>"/></td>
                </tr>
                <tr>
                    <td>价格要求</td>
                    <td><input name="post[price]" type="text" size="20" value="<?php echo $price;?>"/></td>
                </tr>
                <tr style="display: none">
                    <td>产品规格</td>
                    <td><input name="post[standard]" type="text" size="20" value="<?php echo $standard;?>"/></td>
                </tr>
                <tr style="display: none">
                    <td>产品型号</td>
                    <td><input name="post[model]" type="text" size="20" value="<?php echo $model;?>"/></td>
                </tr>
                <tr style="display: none">
                    <td>产品品牌</td>
                    <td><input name="post[brand]" type="text" size="20" value="<?php echo $brand;?>"/></td>
                </tr>
                <tr style="display: none">
                    <td>包装要求</td>
                    <td><input name="post[pack]" type="text" size="20" value="<?php echo $pack;?>"/></td>
                </tr>
                <tr>
                    <td><span class="f_hid">*</span> <?php echo $MOD['name'];?>说明</td>
                    <td><textarea name="post[introduce]" style="width:90%;height:45px;"><?php echo $introduce;?></textarea></td>
                </tr>
            </table>
        </td>
    </tr>
<tr>
    <td class="tl"><span class="f_hid">*</span> 详细说明</td>
	<td><?php echo Post::kindEditor('post[content]', $moduleid, $content, 'datatype="*5-99999" nullmsg="请填写内容" errormsg="内容最少5字"','800px'); ?></td>
</tr>
    <tr style="display: none">
        <td class="tl" height="30"><span class="f_hid">*</span> 内容选项</td>
        <td>
            <input type="checkbox" name="post[save_remotepic]" value="1"<?php if ($MOD['save_remotepic']) echo 'checked';?>/>下载远程图片&nbsp;&nbsp;
            <input type="checkbox" name="post[clear_link]" value="1"<?php if ($MOD['clear_link']) echo 'checked';?>/>清除链接&nbsp;&nbsp;
            截取内容 <input name="post[introduce_length]" type="text" size="2" value="0"/> 字符至简介&nbsp;&nbsp;
            设置内容第 <input name="post[thumb_no]" type="text" size="2" value=""/> 张图片为标题图
        </td>
	</tr>
	<tr>
		<td class="tl"><span class="f_hid">*</span> 图片</td>
		<td>
			<?php echo Post::picture($moduleid, 'thumb', 'post[thumb]', $thumb, $MOD['thumb_width'], $MOD['thumb_height']);?>
		</td>
	</tr>
	<tr>
		<td class="tl"><span class="f_hid">*</span> 图片</td>
		<td>
			<?php echo Post::picture($moduleid, 'thumb', 'post[thumb1]', $thumb1, $MOD['thumb_width'], $MOD['thumb_height']);?>
		</td>
	</tr>
	<tr>
		<td class="tl"><span class="f_hid">*</span> 图片</td>
		<td>
			<?php echo Post::picture($moduleid, 'thumb', 'post[thumb2]', $thumb2, $MOD['thumb_width'], $MOD['thumb_height']);?>
		</td>
	</tr>
	<tr>
    <td class="tl"><span class="f_hid">*</span> 过期时间</td>
		<td><?php echo Post::calender('post[totime]', $totime, 'width:90', true); ?></td>
</tr>

<tr>
    <td class="tl"><span class="f_hid">*</span> 会员信息</td>
    <td>
        <input type="radio" name="ismember" value="1" <?php if ($username) echo 'checked';?> onclick="Dh('d_guest');Ds('d_member');Dd('username').value='<?php echo $username;?>';" id="ismember_1"/><label for="ismember_1"> 是</label>&nbsp;&nbsp;&nbsp;
        <input type="radio" name="ismember" value="0" <?php if (!$username) echo 'checked';?> onclick="Dh('d_member');Ds('d_guest');Dd('username').value='';" id="ismember_0"/><label for="ismember_0"> 否</label>
    </td>
</tr>
<tbody id="d_member" style="display:<?php echo $username ? '' : 'none';?>">
<tr>
    <td class="tl"><span class="f_red">*</span> 会员名</td>
    <td><input name="post[username]" type="text" size="20" value="<?php echo $username;?>" id="username"/> <a href="javascript:_user(Dd('username').value);" class="t">[资料]</a> <span id="dusername" class="f_red"></span></td>
</tr>
</tbody>
<tbody id="d_guest" style="display:<?php echo $username ? 'none' : '';?>">
<tr>
    <td class="tl"><span class="f_red">*</span> 公司名称</td>
    <td class="tr"><input name="post[company]" type="text" id="company" size="50" value="<?php echo $company;?>"/> 个人请填 姓名(个人) 例如：张三(个人)<br/><span id="dcompany" class="f_red"></span></td>
</tr>
<tr>
    <td class="tl"><span class="f_red">*</span> 所在地区</td>
    <td class="tr"><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?> <span id="dareaid" class="f_red"></span></td>
</tr>
<tr>
    <td class="tl"><span class="f_red">*</span> 联系人</td>
    <td class="tr"><input name="post[truename]" type="text" id="truename" size="20" value="<?php echo $truename;?>"/> <span id="dtruename" class="f_red"></span></td>
</tr>
<tr>
    <td class="tl"><span class="f_red">*</span> 联系手机</td>
    <td class="tr"><input name="post[mobile]" id="mobile" type="text" size="30" value="<?php echo $mobile;?>"/> <span id="dmobile" class="f_red"></span></td>
</tr>
<tr style="display: none">
    <td class="tl"><span class="f_hid">*</span> 电子邮件</td>
    <td class="tr"><input name="post[email]" id="email" type="text" size="30" value="<?php echo $email;?>"/> <span id="demail" class="f_red"></span></td>
</tr>
<tr>
    <td class="tl"><span class="f_hid">*</span> 联系电话</td>
    <td class="tr"><input name="post[telephone]" id="telephone" type="text" size="30" value="<?php echo $telephone;?>"/> <span id="dtelephone" class="f_red"></span></td>
</tr>
<tr>
    <td class="tl"><span class="f_hid">*</span> 联系地址</td>
    <td class="tr"><input name="post[address]" type="text" size="60" value="<?php echo $address;?>"/></td>
</tr>

</tbody>
<tr>
    <td class="tl"><span class="f_hid">*</span> 信息状态</td>
    <td>
        <input type="radio" name="post[status]" value="3" <?php if ($status == 3) echo 'checked';?>/> 通过
        <input type="radio" name="post[status]" value="2" <?php if ($status == 2) echo 'checked';?>/> 待审
        <input type="radio" name="post[status]" value="1" <?php if ($status == 1) echo 'checked';?> onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝
        <input type="radio" name="post[status]" value="4" <?php if ($status == 4) echo 'checked';?>/> 过期
        <input type="radio" name="post[status]" value="0" <?php if ($status == 0) echo 'checked';?>/> 删除
    </td>
</tr>
<tr id="note" style="display:<?php echo $status == 1 ? '' : 'none';?>">
    <td class="tl"><span class="f_red">*</span> 拒绝理由</td>
    <td><input name="post[note]" type="text" size="40" value="<?php echo $note;?>"/></td>
</tr>
<tr>
    <td class="tl"><span class="f_hid">*</span> 添加时间</td>
	<td><?php echo Post::datetimeBox('post[addtime]', $addtime, 'width:140'); ?></td>
</tr>

</table>
<div class="sbt"><input type="submit" name="submit" value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="btn"/></div>
</form>
<script type="text/javascript">
	seajs.use(['$', 'vf', 'vf-css', 'easyui','easyui-css'], function($){
		$('#dform').Validform({
			beforeCheck:function(curform){
				lemon.editor.post_content_.sync();
			}
		});
	})
</script>
<?php load('autoinfo.js'); ?>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer'); ?>